#include <stdio.h>

long long lcm(long long num1, long long num2);
long long gcd(long long num1, long long num2);

int main()
{
    long long fuck;
    long long n, m, result, i, j;
    scanf("%ld", &fuck);
    for (j = 0; j < fuck; j++)
    {
        scanf("%ld", &n);
        result = 1;
        for (i = 0; i < n; i++)
        {
            scanf("%ld", &m);
            result = lcm(result, m);
        }
        printf("%ld\n", result);
    }
    return 0;
}

long long gcd(long long num1, long long num2)
{
    long long temp;
    while (num2 != 0)
    {
        temp = num1 % num2;
        num1 = num2;
        num2 = temp;
    }
    return num1;
}

long long lcm(long long num1, long long num2)
{
    return num1 * num2 / gcd(num1, num2);
}